<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <meta name="viewport"
          content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta name="format-detection" content="telephone=no, email=no, date=no, address=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta http-equiv="Pragma" content="no-cache">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="format-detection" content="telephone=no"/>
    <meta name="apple-mobile-web-app-capable" content="yes"/>
    <meta content="black" name="apple-mobile-web-app-status-bar-style">
    <link href="css/bksystem.css" rel="stylesheet" type="text/css"/>
    <link href="font/iconfont.css" rel="stylesheet" type="text/css"/>
    <link href="css/module.css" rel="stylesheet" type="text/css"/>
    <link href="css/pages.css" rel="stylesheet" type="text/css"/>
    <title>添加菜品</title>
    <script src="js/jquery-1.9.1.min.js" type="text/javascript"></script>
    <script src="js/jquery.nicescroll.js" type="text/javascript"></script>
    <script src="js/HUpages.js" type="text/javascript"></script>
    <script src="js/template.js" type="text/javascript"></script>
    <!--[if lt IE 9]>
    <script src="js/html5shiv.js" type="text/javascript"></script>
    <script src="js/css3-mediaqueries.js" type="text/javascript"></script>
    <![endif]-->
    <style>
        body {
            font-family: Arial, sans-serif;
            background-color: #F5F5F5;
            margin: 0;
            padding: 0;
            display: flex;
            justify-content: center;
            align-items: center;
            min-height: 100vh;
            height: 100%;
            overflow-y: scroll;
        }

        form {
            background-color: #FFF;
            padding: 20px;
            border-radius: 4px;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
            width: 400px;
        }

        h1 {
            font-weight: bold;
            color: #333;
            margin-bottom: 20px;
            text-align: center;
        }

        label {
            display: block;
            margin-bottom: 5px;
            font-weight: bold;
            color: #666;
        }

        input[type="text"],
        textarea {
            width: 100%;
            padding: 10px;
            font-size: 16px;
            border: 1px solid #ccc;
            border-radius: 4px;
            box-sizing: border-box;
            margin-bottom: 10px;
        }

        textarea {
            height: 80px;
            resize: vertical;
        }

        input[type="submit"] {
            display: block;
            margin: 0 auto;
            padding: 10px 20px;
            font-weight: bold;
            background-color: #007BFF;
            color: #FFF;
            border: none;
            border-radius: 4px;
            cursor: pointer;
        }

        .error-message {
            color: red;
            font-weight: bold;
            margin-top: 10px;
            text-align: center;
        }
    </style>
</head>
<body>
<form  method="post"  enctype="multipart/form-data" action="${pageContext.request.contextPath}/DrinkServletAdd ">
    <h1 style="margin-top: 30px;">添加饮品</h1>
    <label for="name">饮品名称:</label>
    <input type="text" name="name" id="name" required>


    <label for="description">饮品描述:</label>
    <textarea name="description" id="description"></textarea>

    <label for="price">饮品价格:</label>
    <input type="text" name="price" id="price" required>

    <label for="huodonprice">活动价格:</label>
    <input type="text" name="huodonprice" id="huodonprice" required>

    <label for="feature">口感:</label>
    <input type="text" name="feature" id="feature">

    <label for="status">售卖状态:</label>
    <select name="status" id="status">
        <option value="1">上架</option>
        <option value="0">下架</option>
    </select>
    <select name='statusyuline' id="statusyuline">

    </select>
    <label>文件提交：<input type="file" name="uFile" value="文件上传" id="fileane"><img src="" id="img"></label>
    <input type="submit" value="提交">
</form>
<script>
    $.ajax({
        "url": "lisnemServlet",
        "type": "post",
        "dataType": "json",
        success: function (data) {
            var tbodyStr = "";
            $(data).each(function (index,item) {
                tbodyStr += "<option value="+item.directoryid+">" + item.directoryname + "</option>"
            })
            $("#statusyuline").html(tbodyStr)
        }
    })

</script>
</body>
</html>